package com.gitee.wsl.math.random

import com.gitee.wsl.mathematics.interpolator.Ratio
import com.gitee.wsl.mathematics.interpolator.ext.toRatio
import kotlin.random.Random

fun Random.nextRatio(): Ratio = nextDouble().toRatio()
fun Random.nextRatioInclusive(): Ratio = nextDoubleInclusive().toRatio()

operator fun Random.get(min: Ratio, max: Ratio): Ratio = Ratio(get(min.value, max.value))


/**
 * Returns a random number between 0.0 and 1.0.
 */
 fun Random.randomPercent(): Double {
    return nextDouble()
}

/**
 * Returns a random number between 0.0 and 100.0.
 */
fun Random.randomBigPercent(): Double {
    return nextDouble() * 100
}